var t = getApp();

Page({
    data: {
        storeId: null,
        storeDetail: {},
        workWeek: [ {
            title: "周一",
            value: "1"
        }, {
            title: "周二",
            value: "2"
        }, {
            title: "周三",
            value: "3"
        }, {
            title: "周四",
            value: "4"
        }, {
            title: "周五",
            value: "5"
        }, {
            title: "周六",
            value: "6"
        }, {
            title: "周日",
            value: "7"
        } ]
    },
    onLoad: function(t) {
        var e;
        "" !== (null !== (e = t.storeId) && void 0 !== e ? e : "") && (this.data.storeId = parseInt(t.storeId)), 
        this.storeDetail();
    },
    storeDetail: function() {
        var e = this, a = t.getNetAddresss("plugin.coupon-store.frontend.store.storeDetail"), o = {
            store_id: this.data.storeId
        };
        t._postNetWork({
            url: a,
            data: o,
            success: function(t) {
                var a = t.data;
                if (1 == a.result) {
                    var o, n = "".concat(a.data.province).concat(a.data.city).concat(a.data.district).concat(a.data.street).concat(a.data.address), i = a.data.work_week;
                    o = e.data.workWeek.filter(function(t) {
                        return i.indexOf(t.value) > -1;
                    });
                    var s = "".concat(o[0].title, "至").concat(o[o.length - 1].title);
                    e.setData({
                        storeDetail: a.data,
                        addressDetail: n,
                        workTime: s
                    });
                } else wx.showToast({
                    icon: "none",
                    title: a.msg,
                    duration: 1500
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});